package cn.tedu.online.day10;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class DeleteList {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("aaabbbccc1");
        list.add("aaabbbccc2");
        list.add("aaabbbccc3");
        list.add("aaabbbccc4");
        list.add("aaabbbccc5");
        list.add("aaabbbccc6");
        list.add("aaabbbccc7");

        Iterator<String> it = list.iterator();
        while (it.hasNext()){
            String ele = it.next();
            //截取出整数,判断是否是2的倍数
            int x = Integer.parseInt(ele.substring(9));
            if (x%2==0)
                it.remove();;
        }

        list.forEach(e-> System.out.println(e));



    }
}
